import { BasicColumn, FormSchema } from '@/components/Table';
import { h, ref } from 'vue';
import { Tag } from 'ant-design-vue';
import {VxeGridPropTypes} from "@/components/VxeTable";


//表格列名
export const columns: BasicColumn[] = [
  {
    title: '团队名称',
    dataIndex: 'name',
  },
  {
    title: '团队部门',
    dataIndex: 'deptName',
    width: 130,
  },
  {
    title: '排序',
    dataIndex: 'sort',
    width: 80,
  },
  // {
  //   title: '得分',
  //   dataIndex: 'trueScore',
  //   width: 130,
  // },
  // {
  //   title: '扣分',
  //   dataIndex: 'erroScore',
  //   width: 130,
  // },
  {
    title: '创建时间',
    width: 250,
    dataIndex: 'createTime',
  },
];

export const searchFormSchema: FormSchema[] = [
  {
    field: 'keyword',
    label: '搜索',
    component: 'Input',
    colProps: { span: 8 },
  },
];

export const formSchema: FormSchema[] = [
  {
    field: 'name',
    label: '团队名称',
    component:"Input",
    required: true,
  },
  {
    field: 'deptName',
    label: '团队部门',
    component:"Input",
    required: true,
  },
  {
    field: 'sort',
    label: '排序',
    component: 'InputNumber',
    required: true,
  },
  // {
  //   field: 'trueScore',
  //   label: '得分',
  //   component: 'InputNumber',
  // },
  // {
  //   field: 'erroScore',
  //   label: '扣分',
  //   component: 'InputNumber',
  // },
  {
    field: 'items',
    label: '成员',
    slot: 'items',
    colProps: { lg: 24, md: 24 },
  },

];



export const teamUserColumns: VxeGridPropTypes.Columns = [
  {
    title: '姓名',
    field: 'userName',
    showOverflow: 'title',
  },
  {
    width: 120,
    title: '操作',
    align: 'center',
    field: '',
    slots: { default: 'action' },
    fixed: 'right',
  },
  ]


export const ruleTableSchema: FormSchema[] = [

  {
    field: 'rules',
    label: '计分规则',
    slot: 'rules',
    colProps: { lg: 24, md: 24 },
  },

];

export const ruleSchema: FormSchema[] = [

  {
    field: 'type',
    label: '排序',
    component: 'Select',
    required: true,
    componentProps: {
      options: [
        { label: '本部门', value: '本部门' },
        { label: '非本部门', value: '非本部门' },
      ],
    },
  },
  {
    field: 'trueScore',
    label: '得分',
    component: 'InputNumber',
    required: true,

  },
  {
    field: 'erroScore',
    label: '扣分',
    component: 'InputNumber',
    componentProps:{
      placeholder:"请输入正整数"
    },
    helpMessage:"请输入正整数"
  },
  {
    field: 'id',
    label: 'id',
  },

];

export const ruleTablesColumns: VxeGridPropTypes.Columns = [
  {
    title: '类型',
    field: 'type',
    showOverflow: 'title',
  },
  {
    title: '得分',
    field: 'trueScore',
    showOverflow: 'title',
  },
  {
    title: '扣分',
    field: 'erroScore',
    showOverflow: 'title',
  },

  {
    width: 120,
    title: '操作',
    align: 'center',
    field: '',
    slots: { default: 'action' },
    fixed: 'right',
  },
]
